import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SystemTypeVO, SystemTypeForm, SystemTypeQuery } from '@/api/assess/system/systemType/types';

/**
 * 查询指标体系列列表
 * @param query
 * @returns {*}
 */

export const listSystemType = (query?: SystemTypeQuery): AxiosPromise<SystemTypeVO[]> => {
  return request({
    url: '/assess/system/systemType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询指标体系列详细
 * @param id
 */
export const getSystemType = (id: string | number): AxiosPromise<SystemTypeVO> => {
  return request({
    url: '/assess/system/systemType/' + id,
    method: 'get'
  });
};

/**
 * 新增指标体系列
 * @param data
 */
export const addSystemType = (data: SystemTypeForm) => {
  return request({
    url: '/assess/system/systemType',
    method: 'post',
    data: data
  });
};

/**
 * 修改指标体系列
 * @param data
 */
export const updateSystemType = (data: SystemTypeForm) => {
  return request({
    url: '/assess/system/systemType',
    method: 'put',
    data: data
  });
};

/**
 * 删除指标体系列
 * @param id
 */
export const delSystemType = (id: string | number | Array<string | number>) => {
  return request({
    url: '/assess/system/systemType/' + id,
    method: 'delete'
  });
};
